﻿<!--#include file="const.asp"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>
<%
if sid="Null" then
	Response.Redirect "login.asp"
	Response.end
end if
IF  Request.QueryString("Action")="save" Then
	call savea
elseif Request.QueryString("Action")="sat" Then
	call satt
else
	call index
end if
end Function
Function index
dim rs,sql,i,ad,fleg,fleg1,j,rst,sqlt
%>
<card title="页面静态化管理"><p align="left">
=页面静态化管理=<br/>静态化规则:要静态化页面,操作时必须由上到下选择页面进行静态化,不能由下而上,否则静态化页面会不完全,另外注意如果要再次静态化请执行操作前先复原<br/>
<%  
on error resume next             
	Set Rs = Server.CreateObject("Adodb.Recordset")
		sql="select fleg,ext from [qingtian_class] where fleg<>0 order by fleg desc"
		Rs.Open Sql,conn,1,1
		if not (rs.bof and rs.eof)  then
                fleg=0
		For i=1 to rs.RecordCount
                fleg1=fleg
                fleg=rs("fleg")
		If Rs.Eof Then
			exit For
		End If
                 if fleg<>fleg1 then
	Set Rst = Server.CreateObject("Adodb.Recordset")
		sqlt="select name,fleg,ext,vipgm from [qingtian_class] where id="&rs("fleg")&" order by fleg desc"
		Rst.Open Sqlt,conn,1,1
		if not (rst.bof and rst.eof)  then
                j=j+1
                if rst("vipgm")=0 then
                if rst("ext")=0 then
%>
<%=j%>.<%=qingtian.utf8(rst("name"))%><br/>[<a href='add.asp?act=3&amp;action=save&amp;ad=tian.asp?id=<%=rs("fleg")%>&amp;id=<%=rs("fleg")%>&amp;sid=<%=sid%>'>静态化</a>.复原]<br/>
                <%elseif rst("ext")=7 then%>
<%=j%>.<%=qingtian.utf8(rst("name"))%><br/>[<a href='add.asp?act=3&amp;action=save&amp;ad=viewli.asp?listid=<%=rs("fleg")%>&amp;id=<%=rs("fleg")%>&amp;sid=<%=sid%>'>静态化</a>.复原]<br/>
<%
                end if
                else
                if rst("ext")=0 then
%>
<%=j%>.<%=qingtian.utf8(rst("name"))%><br/>[静态化.<a href='add.asp?act=3&amp;action=sat&amp;id=<%=rs("fleg")%>&amp;sid=<%=sid%>'>复原</a>]<br/>
                <%elseif rst("ext")=7 then%>
<%=j%>.<%=qingtian.utf8(rst("name"))%><br/>[静态化.<a href='add.asp?act=3&amp;action=sat&amp;id=<%=rs("fleg")%>&amp;sid=<%=sid%>'>复原</a>]<br/>
<%
                end if
                end if
		end if
		Rst.close
                set rst=nothing

			end if
	 	Rs.MoveNext
	  	Next
		end if
		Rs.close
                set rs=nothing
%>
a.网站首页<a href='add.asp?act=1&amp;action=save&amp;sid=<%=sid%>'><br/>[静态化</a>.<a href='add.asp?act=1&amp;action=sat&amp;sid=<%=sid%>'>复原</a>]<br/>
b.论坛首页<a href='add.asp?act=2&amp;action=save&amp;sid=<%=sid%>'><br/>[静态化</a>.<a href='add.asp?act=2&amp;action=sat&amp;sid=<%=sid%>'>复原</a>]<br/>
<a href='index.asp?sid=<%=sid%>'>后台管理首页</a><br/>
<%
end Function 


Function savea
		dim txt,path,body,body1,wstr,url,start,over,act,ad,id
    		id = Request.QueryString("id")    
    		If id = "" Then id = 1
   		If Not IsNumeric(id) Then id = 1
    		id = CLng(id)
act=Request.QueryString("act")
ad=Request.QueryString("ad")

if act=1 then
         Url="http://"&Request.ServerVariables("SERVER_NAME")&"/index.asp?sid=Null-1-jfj"	'传送过去的内容
         wstr=qingtian.getHTTPPage(Url)
start=Instr(wstr,"<title>")
over=Instr(wstr,"</body>")
body1=mid(wstr,start,over-start)
body1=Replace(body1, "Null-1-jfj-1", "lt;qt;=siddqt;gt;")
         Url1="http://"&Request.ServerVariables("SERVER_NAME")&"/index.asp?sid=Null-0-a"	'传送过去的内容
         wstr1=qingtian.getHTTPPage(Url1)
start1=Instr(wstr1,"</head>")
over1=Instr(wstr1,"</wml>")
body2=mid(wstr1,start1,over1-start1)
body2=Replace(body2, "Null-0-a-1", "lt;qt;=siddqt;gt;")
elseif act=2 then
         Url="http://"&Request.ServerVariables("SERVER_NAME")&"/bbs/index.asp?sid=Null-1-jfj"	'传送过去的内容
         wstr=qingtian.getHTTPPage(Url)
start=Instr(wstr,"<title>")
over=Instr(wstr,"</body>")
body1=mid(wstr,start,over-start)
body1=Replace(body1, "Null-1-jfj-1", "lt;qt;=siddqt;gt;")
         Url1="http://"&Request.ServerVariables("SERVER_NAME")&"/bbs/index.asp?sid=Null-0-a"	'传送过去的内容
         wstr1=qingtian.getHTTPPage(Url1)
start1=Instr(wstr1,"</head>")
over1=Instr(wstr1,"</wml>")
body2=mid(wstr1,start1,over1-start1)
body2=Replace(body2, "Null-0-a-1", "lt;qt;=siddqt;gt;")
else
         Url="http://"&Request.ServerVariables("SERVER_NAME")&"/"&ad&"&sid=Null-1-jfj"	'传送过去的内容
         wstr=qingtian.getHTTPPage(Url)
start=Instr(wstr,"<title>")
over=Instr(wstr,"</body>")
body1=mid(wstr,start,over-start)
body1=Replace(body1, "Null-1-jfj-1", "lt;qt;=siddqt;gt;")
         Url1="http://"&Request.ServerVariables("SERVER_NAME")&"/"&ad&"&sid=Null-0-a"	'传送过去的内容
         wstr1=qingtian.getHTTPPage(Url1)
start1=Instr(wstr1,"</head>")
over1=Instr(wstr1,"</wml>")
body2=mid(wstr1,start1,over1-start1)
body2=Replace(body2, "Null-0-a-1", "lt;qt;=siddqt;gt;")
end if
if act<>2 then
body2=Replace(body2, "<a href=""/", "<a href=""")
body2=Replace(body2, "<a href=""", "<a href=""/")
body2=Replace(body2, "<a href=""/http://", "<a href=""http://")
body1=Replace(body1, "<a href=""/", "<a href=""")
body1=Replace(body1, "<a href=""", "<a href=""/")
body1=Replace(body1, "<a href=""/http://", "<a href=""http://")
end if
body2=Replace(body2, "Null", "lt;qt;=sidqt;gt;")
body1=Replace(body1, "Null", "lt;qt;=sidqt;gt;")
body="lt;qt;at;LANGUAGE=""VBSCRIPT"" CODEPAGE=""65001""qt;gt;" & chr(13) & chr(10)
body=body&"lt;qt;" & chr(13) & chr(10)
body=body&"Response.Buffer = True" & chr(13) & chr(10)

body=body&"on error resume next" & chr(13) & chr(10)
body=body&"dim sidd,siddd,sid,v,fv" & chr(13) & chr(10)
body=body&"sidd=Request.QueryString(""sid"")" & chr(13) & chr(10)
body=body&"if sidd="""" then " & chr(13) & chr(10)
body=body&"sid=""Null""" & chr(13) & chr(10)
body=body&"dim ppwap,pppwap" & chr(13) & chr(10)
body=body&"ppwap=Left(Request.ServerVariables(""HTTP_USER_AGENT""),4)" & chr(13) & chr(10)
body=body&"pppwap=right(Request.ServerVariables(""HTTP_ACCEPT""),10)" & chr(13) & chr(10)
body=body&"pppwap=right(Request.ServerVariables(""HTTP_ACCEPT""),10)" & chr(13) & chr(10)
body=body&"if instr(ppwap,""Oper"")>0 or instr(ppwap,""Smar"")>0 or instr(ppwap,""Symb"")>0 or instr(ppwap,""NetF"")>0 or instr(ppwap,""Winw"")>0 or instr(ppwap,""Wapi"")>0 or instr(ppwap,""Mc21"")>0 or instr(ppwap,""Up.b"")>0 or instr(ppwap,""Upg1"")>0 or instr(ppwap,""Upsi"")>0 or instr(ppwap,""Qwap"")>0 or instr(ppwap,""Jigs"")>0 or instr(ppwap,""Java"")>0 or instr(ppwap,""Alca"")>0 or instr(ppwap,""Wapj"")>0 or instr(ppwap,""Fetc"")>0 or instr(ppwap,""R380"")>0 or instr(ppwap,""Mozi"")>0 or instr(ppwap,""M3ga"")>0 or instr(ppwap,""CE"")>0 or instr(pppwap,""UC"")>0 then" & chr(13) & chr(10)
body=body&"v=1" & chr(13) & chr(10)
body=body&"fv=""a""" & chr(13) & chr(10)
body=body&"else" & chr(13) & chr(10)
body=body&"v=0" & chr(13) & chr(10)
body=body&"fv=""a""" & chr(13) & chr(10)
body=body&"end if" & chr(13) & chr(10)
body=body&"else" & chr(13) & chr(10)
body=body&"siddd=Split(sidd,""-"")" & chr(13) & chr(10)
body=body&"sid=siddd(0)" & chr(13) & chr(10)
body=body&"v=siddd(1)" & chr(13) & chr(10)
body=body&"fv=siddd(2)" & chr(13) & chr(10)
body=body&"end if" & chr(13) & chr(10)
body=body&"if v=1 then" & chr(13) & chr(10)
body=body&"qt;gt;" & chr(13) & chr(10)
body=body&"lt;?xml version=""1.0"" encoding=""utf-8""?gt;" & chr(13) & chr(10)
body=body&"lt;!DOCTYPE html PUBLIC ""-//WAPFORUM//DTD XHTML Mobile 1.0//EN"" ""http://www.wapforum.org/DTD/xhtml-mobile10.dtd""gt;" & chr(13) & chr(10)
body=body&"lt;html xmlns=""http://www.w3.org/1999/xhtml""gt;" & chr(13) & chr(10)
body=body&"lt;headgt;" & chr(13) & chr(10)
body=body&"lt;meta http-equiv=""content-type"" content=""application/xhtml+xml; charset=UTF-8""/gt;" & chr(13) & chr(10)
body=body&"lt;meta name=""keywords"" content=""晴天3g建站系统,3g建站,程序开发,定做程序,wap建站"" /gt;" & chr(13) & chr(10)
body=body&"lt;link rel=""stylesheet"" href=""/css/lt;qt;=fvqt;gt;.css"" type=""text/css"" /gt;" & chr(13) & chr(10)
body=body&body1
body=body&"lt;/bodygt;" & chr(13) & chr(10)
body=body&"lt;/htmlgt;" & chr(13) & chr(10)
body=body&"lt;!--晴天3G建站系统-wap.qt3g.com--gt;" & chr(13) & chr(10)
body=body&"lt;qt;else" & chr(13) & chr(10)
body=body&"Response.ExpiresAbsolute = Now() - 1" & chr(13) & chr(10) 
body=body&"Response.Expires = 0" & chr(13) & chr(10) 
body=body&"Response.CacheControl = ""no-cache""" & chr(13) & chr(10) 
body=body&"Response.AddHeader ""Pragma"", ""no-cache""" & chr(13) & chr(10)
body=body&"Response.AddHeader ""Cache-Control"", ""no-cache, must-revalidate""" & chr(13) & chr(10)
body=body&"Response.ContentType = ""text/vnd.wap.wml; charset=utf-8""" & chr(13) & chr(10)
body=body&"Response.Write ""<?xml version=""""1.0"""" encoding=""""utf-8""""?>""zt;" & chr(13) & chr(10)
body=body&"Response.Write ""<!DOCTYPE wml PUBLIC """"-//WAPFORUM//DTD WML 1.2//EN"""" """"http://www.wapforum.org/DTD/wml12.dtd"""">""zt;" & chr(13) & chr(10)
body=body&"Response.Write ""<wml>""zt;" & chr(13) & chr(10)
body=body&"Response.Write ""<head>""zt;" & chr(13) & chr(10)
body=body&"Response.Write ""<meta http-equiv=""""Cache-Control"""" content=""""ust-revalidate"""" forua=""""true""""/>""zt;" & chr(13) & chr(10)
body=body&"Response.Write ""<meta http-equiv=""""Cache-Control"""" content=""""no-cache"""" forua=""""true""""/>""zt;" & chr(13) & chr(10)
body=body&"Response.Write ""<meta http-equiv=""""Cache-Control"""" content=""""max-age=0"""" forua=""""true""""/>""zt;" & chr(13) & chr(10)
body=body&"Response.Write ""<meta http-equiv=""""Expires"""" content=""""0"""" forua=""""true""""/>""zt;" & chr(13) & chr(10)
body=body&"Response.Write ""<meta http-equiv=""""Pragma"""" content=""""no-cache"""" forua=""""true""""/>""zt;" & chr(13) & chr(10)
body=body&"qt;gt;" & chr(13) & chr(10)
body=body&body2
body=body&"lt;/wmlgt; " & chr(13) & chr(10)
body=body&"lt;!--晴天3G建站系统-wap.qt3g.com--gt;" & chr(13) & chr(10)
body=body&"lt;qt;end if" & chr(13) & chr(10)
body=body&"Response.end" & chr(13) & chr(10)
body=body&"qt;gt;" & chr(13) & chr(10)


txt=Replace(body, "at;", "@")
txt=Replace(txt, "lt;", "<")
txt=Replace(txt, "gt;", ">")
txt=Replace(txt, "qt;", "%")
txt=Replace(txt, "zt;", " & chr(13) & chr(10)")
if act=1 then
path="index.asp"
elseif act=2 then
path="bbs/index.asp"
else
path="html/main"&id&".asp"
conn.execute("update qingtian_class set [vipgm]=1 where [id]="&id&"")
end if
qingtian.CreateFilet txt,path
	%>
<card title="页面静态化管理"><p align="left">
		页面静态化成功!<br/>
<a href='add.asp?sid=<%=sid%>'>返回静态化管理</a><br/>
<a href='index.asp?sid=<%=sid%>'>后台管理首页</a><br/>
<%
end Function

Function satt
		dim dir,path,fso,act,id
    		id = Request.QueryString("id")    
    		If id = "" Then id = 1
   		If Not IsNumeric(id) Then id = 1
    		id = CLng(id)
act=Request.QueryString("act")
if act=1 then
SET Fso = CreateObject("Scripting.FileSystemObject")
dir="/index.asp"
path="/html/index1.asp"
Fso.DeleteFile Server.MapPath(dir),True
Fso.CopyFile Server.MapPath(path),Server.MapPath(dir)
set fso=nothing
elseif act=2 then
SET Fso = CreateObject("Scripting.FileSystemObject")
dir="/bbs/index.asp"
path="/html/index2.asp"
Fso.DeleteFile Server.MapPath(dir),True
Fso.CopyFile Server.MapPath(path),Server.MapPath(dir)
set fso=nothing
else
conn.execute("update qingtian_class set [vipgm]=0 where [id]="&id&"")
end if
%>
<card title="页面静态化管理"><p align="left">
		页面成功复原!<br/>
<a href='add.asp?sid=<%=sid%>'>返回静态化管理</a><br/>
<a href='index.asp?sid=<%=sid%>'>后台管理首页</a><br/>
<%
end Function
%>
